
class ManKind {

    int sex;
    int salary;

    // 根据 sex 的值显示“man”(sex==1)或者“woman”(sex==0)
    void manOrWoman() {
        if (sex == 1) {
            System.out.println("man");
        } else if (sex == 0) {
            System.out.println("woman");
        }
    }


    void employeed() {
        if (salary == 0) {
            System.out.println("no job");
        } else {
            System.out.println("job");
        }
    }
}

// 定义 Kids 类，继承自 ManKind
class Kids extends ManKind {

    int yearsOld;


    void printAge() {
        System.out.println("Age: " + yearsOld);
    }
}


 class KidsTest {
    public static void main(String[] args) {

        Kids someKid = new Kids();

        someKid.sex = 1;
        someKid.salary = 0;

        someKid.yearsOld = 10;

        // 调用父类的方法
        someKid.manOrWoman();
        someKid.employeed();
        // 调用子类的方法
        someKid.printAge();
    }
}